﻿<!DOCTYPE HTML>
<html>

<head>
	<title></title>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="Bookmark" href="/favicon.ico">
	<link rel="Shortcut Icon" href="/favicon.ico" />
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/static/h-ui.admin/css/style.css" />
	<style>
		.neirong {
			overflow: hidden;
		}

		.box_b {
			width: 240px;
		}

		.tit {
			height: 65px;
			background: #d2d2d2;
			line-height: 65px;
			font-size: 17px;
			width: 100%;
		}
	</style>
</head>

<body>
<include file="header"/>
<include file="aside"/>
	<div class="page-container safe_center Hui-article-box">
		<div class="tit">修改密码</div>
		<form class="form form-horizontal col-md-9" id="form-article-add" action=" " method="post">
			<div id="tab-system" class="HuiTab neirong">
				<div class="tabCon">
					<div class="row cl">
						<label class="form-label col-xs-2 col-sm-2">
							旧密码：</label>
						<div class="formControls col-xs-9 col-sm-9 box_b">
							<input name="oldPw" type="text" id="website-title" placeholder="请输入旧密码" value="" class="input-text">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-2 col-sm-2">
							新密码：</label>
						<div class="formControls col-xs-9 col-sm-9 box_b">
							<input name="newPw" type="text" id="website-Keywords" placeholder="请输入新密码" value="" class="input-text">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-2 col-sm-2">
							确认密码：</label>
						<div class="formControls col-xs-9 col-sm-9 box_b">
							<input name="conPw" type="text" id="website-description" placeholder="请再次输入密码" value="" class="input-text">
						</div>
					</div>
					<div style="margin-top: 40px;display: flex;justify-content: center;width: 24%;">
						<!--<button name="" id="" class="btn btn-success" type="submit">确认</button>-->
						<input name="submit" class="btn btn-success" onclick="checkLogin()"  type="button" value="确认">
					</div>
				</div>
			</div>
		</form>
	</div>

	<script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/lib/layer/2.4/layer.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/static/h-ui/js/H-ui.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/static/h-ui.admin/js/H-ui.admin.js"></script>


	<script type="text/javascript" src="__PUBLIC__/Admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
	<script src="__PUBLIC__/layui/layui.js"></script>
    <script src="__PUBLIC__/layui/layui.all.js"></script>

<script type="text/javascript">
		$(function () {
			$('.skin-minimal input').iCheck({
				checkboxClass: 'icheckbox-blue',
				radioClass: 'iradio-blue',
				increaseArea: '20%'
			});
			$("#tab-system").Huitab({
				index: 0
			});
		});


		function checkLogin() {
			var oldPw=$("input:text[name='oldPw']").val();
			var newPw=$("input:text[name='newPw']").val();
			var conPw=$("input:text[name='conPw']").val();

			if(oldPw==''){
                layer.msg('旧密码不能为空', {icon: 5});
                return false;
            }
            if(newPw==''){
                layer.msg('新密码不能为空', {icon: 5});
                return false;
            }
            if(conPw==''){
                layer.msg('确认密码不能为空', {icon: 5});
                return false;
            }
            if(newPw!==conPw){
                layer.msg('两次密码不一致', {icon: 5});
                return false;
			}

            $.ajax({
                type: "post",
                url: "{:U('Admin/safeCenterAjax')}",
                data: {"oldPw": oldPw,"newPw": newPw,"conPw": conPw, },
                success:function (result) {
                    if ( result == 10 ) {
                        layer.msg('操作成功', {icon: 1});
                        window.location.href='Location:http://localhost/Bside/Admin/Admin/index'
                        return false;
                    } else {
                        layer.msg('操作失败', {icon: 5});
                        return false;

                    }
                }
            })




        }
	</script>

</body>

</html>